import request from '@/utils/request';
import { AxiosPromise } from 'axios';


/**
 * 数据导入
 * @param data
 */
export function homepageImport(data: any) {
  const formData = new FormData();
  formData.append('file', data.file);
  formData.append("contentType", 'image/png');
  return request({
    url: '/api/transit/homepage/import',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: formData
  })
} 

/**
 * 模板导出
 * @param data
 */
export function homepageExport(data: any) {
  return request({
    url: '/api/transit/homepage/templateexport',
    method: 'post',
    data
  });
} 

/**
 * 修改状态是否是开启
 * @param data
 */
export function updateHomepagestate(data: any) {
  return request({
    url: '/api/transit/homepage/homepagestate',
    method: 'post',
    data
  });
}

/**
 * 获取集合数据
 * @param data
 */
export function getHomepagestaticlist(data: any) {
  return request({
    url: '/api/transit/homepage/homepagestaticlist',
    method: 'post',
    data
  });
}


/**
 * 危险路段, 首页数据信息展示
 * @param data
 */
export function getSafetyPromptInvokeCount(data: any) {
  return request({
    url: '/api/transit/monitor/safetyPromptInvokeCount',
    method: 'post',
    data
  });
}

/**
 * 道路限速, 首页数据信息展示
 * @param data
 */
export function getSpeedLimitInvokeCount (data: any) {
  return request({
    url: '/api/transit/monitor/speedLimitInvokeCount',
    method: 'post',
    data
  });
}

/**
 * 查询围栏个数，首页数据信息展示
 * @param data
 */
export function getDenceNumberFind (data: any) {
  return request({
    url: '/api/transit/fence/fenceNumberFind',
    method: 'post',
    data
  });
}

/**
 * 线路总数查询，首页数据信息展示
 * @param data
 */
export function getLineNumberFind (data: any) {
  return request({
    url: '/api/transit/line/lineNumberFind',
    method: 'post',
    data
  });
}

/**
 * 车辆数量统计，首页数据信息展示
 * @param data
 */
export function getCarStatistics (data: any) {
  return request({
    url: '/api/transit/car/carStatistics',
    method: 'post',
    data
  });
}

/**
 * 风险提示分类占比
 * @param data
 */
export function getRiskAlertClassification (data: any) {
  return request({
    url: '/api/transit/monitor/riskAlertClassification',
    method: 'post',
    data
  });
}

/**
 * 车辆实时在线统计
 * @param data
 */
export function getcarStatusCount (data: any) {
  return request({
    url: '/api/transit/car/car/status/count',
    method: 'post',
    data
  });
}

/**
 * 偏离围栏告警趋势
 * @param data
 */
export function getOffFenceTendency(data: any) {
  return request({
    url: '/api/transit/monitor/offFenceTendency',
    method: 'post',
    data
  });
}

/**
 * 超速告警趋势
 * @param data
 */
export function getOverSpeedTendency(data: any) {
  return request({
    url: '/api/transit/monitor/overSpeedTendency',
    method: 'post',
    data
  });
}


/**
 * 风险提示信息统计
 * @param data
 */
export function getAlarmDataStatistics(data: any) {
  return request({
    url: '/api/transit/monitor/alarmDataStatistics',
    method: 'post',
    data
  });
}
